<?php
ini_set("display_errors", "On"); 
error_reporting(E_ALL | E_STRICT);
function micro_time()
{
   list($usec, $sec) = explode(" ", microtime());
   return ($usec * 1000000 + $sec * 1000000);
}

$starttime = micro_time();
$ch = curl_init();
$header = [
   "name: cxy"
];

$url = "http://www.baidu.com?a=a";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, "0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

$info = curl_getinfo($ch, CURLOPT_POST);
var_dump($info);
$output = curl_exec($ch);
//print_r($header);
//var_dump($output);
curl_close($ch);
$endtime = micro_time();
var_dump("时间差:" . ($endtime - $starttime));